home *** CD-ROM | disk | FTP | other *** search
- Path: engnews1.Eng.Sun.COM!taumet!clamage
- From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson)
- Newsgroups: comp.std.c++
- Subject: Re: Kind of Annoying
- Date: 17 Apr 1996 14:57:36 GMT
- Organization: Comp Sci, University of Melbourne
- Approved: clamage@eng.sun.com (comp.std.c++)
- Message-ID: <4l2et2$rik@mulga.cs.mu.OZ.AU>
- References: <4kjpfq$r3k@news2.cais.com>
- NNTP-Posting-Host: taumet.eng.sun.com
- X-Nntp-Posting-Host: mundook.cs.mu.oz.au
- Content-Length: 824
- X-Lines: 39
- Originator: clamage@taumet
-
- jah@cais.cais.com (John A Hughes) writes:
-
- >The following doesn't compile, because the calls to foo look ambiguous
- >to the compiler:
- >
- >template<class T>
- >class Goo {
- >public:
- > void foo(T *) {}
- >};
- [...]
- >class C : public Goo<A>, public Goo<B> {
-
- I believe that if you add
-
- public:
- using Goo<A>::foo;
- using Goo<B>::foo;
-
- here in the declaration of class C, this will resolve the ambiguities
- in the calls below:
-
- >};
- >
- >main() {
- > A a;
- > B b;
- > C c;
- > c.foo(&a);
- > c.foo(&b);
- >}
-
- Unfortunately, however, none of the C++ compilers that I have access
- to support this yet.
-
- --
- Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
- WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
- PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.
-
-
- [ comp.std.c++ is moderated. To submit articles: try just posting with ]
- [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
- [ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
- [ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
- [ Comments? mailto:std-c++-request@ncar.ucar.edu ]
-